package com.liqi.display.common;

import java.util.ArrayList;
import java.util.List;

public enum SystemCode {
    /**
     * 密码错误
     */
    SYS_OK(0,"操作成功!"),
    SYS_FAIL(-1,"操作失败!");//设备异常


    private Integer KEY ;
    private String VALUE;

    SystemCode(Integer KEY, String VALUE){
        this.KEY = KEY;
        this.VALUE = VALUE;
    }

    public Integer getKey() {
        return KEY;
    }

    public String getValue() {
        return VALUE;
    }



    public static SystemCode valueOfCode(Integer code) {
        for (SystemCode e : SystemCode.values()) {
            if (e.getKey().equals(code)) {
                return e;
            }
        }
        return null;
    }

    public static String get(String key) {
        for (SystemCode e : SystemCode.values()) {
            if (e.getKey().equals(key)) {
                return e.getValue();
            }
        }
        return null;
    }
}
